Skip to content

Add Johannesburg Stock Exchange (JSE) holidays#3714

Open
pareshjoshij wants to merge 6 commits into
vacanza:devfrom
pareshjoshij:add_JSE
Open

Add Johannesburg Stock Exchange (JSE) holidays#3714
pareshjoshij wants to merge 6 commits into
vacanza:devfrom
pareshjoshij:add_JSE

Conversation

@pareshjoshij

Copy link
Copy Markdown
Contributor

Proposed change

This PR adds the holidays for the Johannesburg Stock Exchange (JSE) financial calendar.

Part of GSoC (#3424)

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code quality improvement (best practice, cleanup, refactoring, optimization)
  • Documentation update
  • Test suite update
  • Development process update (CI/CD, project configuration, internal tooling)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Signed-off-by: Paresh Joshi <194076591+pareshjoshij@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the test label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4588df3e-3148-4ec9-96be-be76daa33807

📥 Commits

Reviewing files that changed from the base of the PR and between 628fc0f and 73d3d6d.

📒 Files selected for processing (1)
  • holidays/financial/johannesburg_stock_exchange.py

Summary by CodeRabbit

  • New Features

    • Added Johannesburg Stock Exchange (JSE/XJSE) holiday calendar support (from 2000), including public holidays and half-day closures for Christmas Eve and New Year’s Eve at 12:00 p.m. SAST, with weekend-aligned observance.
    • Included JSE/XJSE in the financial markets registry for easier discovery.
  • Tests

    • Added dedicated JSE/XJSE tests covering half-day behavior and the full 2025 holiday set.
  • Documentation

    • Updated the README “Available Financial Markets” table with Johannesburg Stock Exchange (XJSE) and supported HALF_DAY category.

Walkthrough

Adds Johannesburg Stock Exchange holiday support, including weekend filtering, Christmas Eve and New Year’s Eve half-days, public exports, registry discovery, README documentation, and tests for observed rules and 2025 holidays.

Changes

Johannesburg Stock Exchange

Layer / File(s) Summary
JSE holiday behavior
holidays/financial/johannesburg_stock_exchange.py
Defines the JSE calendar, removes weekend public holidays, adds Christmas Eve and New Year’s Eve half-days, and provides JSE/XJSE aliases.
Financial registry and exports
holidays/registry.py, holidays/financial/__init__.py, README.md
Registers the exchange codes, exports the new entities, and documents the market.
Calendar behavior tests
tests/financial/test_johannesburg_stock_exchange.py
Tests identifiers, observed rules, full-day holidays, and 2025 half-day holidays.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • vacanza/holidays#3692: Uses the same SAT_SUN_TO_NONE weekend and observed-day rule in another financial holiday provider.

Suggested reviewers: kjhellico

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Johannesburg Stock Exchange holidays.
Description check ✅ Passed The description is directly related to the PR and correctly states that it adds JSE financial calendar holidays.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Confidence score: 3/5

  • In tests/financial/test_johannesburg_stock_exchange.py, assertHalfDayNonObservedHolidayName(..."12-24"...) appears to ignore weekend holiday-shift behavior, so years like 2022/2023 can fail even when the calendar logic is correct; merging as-is risks flaky or consistently failing CI around those dates — update the test to account for SAT/SUN move rules (or assert against observed dates) before merging.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/financial/test_johannesburg_stock_exchange.py">

<violation number="1" location="tests/financial/test_johannesburg_stock_exchange.py:31">
P1: `self.assertHalfDayNonObservedHolidayName(name, (f"{year}-12-24" for year in self.full_range))` will fail for years where Dec 24 falls on Saturday/Sunday (e.g., 2022, 2023). The JSE's `_move_holiday(rule=SAT_SUN_TO_NONE)` removes weekend Christmas Eve dates during population — this runs regardless of the `observed` flag — so the non-observed instance also lacks those entries. Wrap this assertion with a weekend filter, or assert `assertHalfDayNonObservedHolidayName` only for weekday years and `assertNoHalfDayNonObservedHolidayName` for weekend years.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/financial/test_johannesburg_stock_exchange.py
Comment thread tests/financial/test_johannesburg_stock_exchange.py
Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c382fde) to head (73d3d6d).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3714   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          321       322    +1     
  Lines        19320     19344   +24     
  Branches      2477      2479    +2     
=========================================
+ Hits         19320     19344   +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
Comment thread holidays/financial/johannesburg_stock_exchange.py
@pareshjoshij
pareshjoshij requested a review from KJhellico July 23, 2026 13:31
Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

KJhellico
KJhellico previously approved these changes Jul 24, 2026

@KJhellico KJhellico left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

PPsyrius
PPsyrius previously approved these changes Jul 25, 2026

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🇿🇦

Copilot AI review requested due to automatic review settings July 26, 2026 01:25
@arkid15r
arkid15r dismissed stale reviews from PPsyrius and KJhellico via 73d3d6d July 26, 2026 01:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@arkid15r
arkid15r enabled auto-merge July 26, 2026 01:26
@arkid15r
arkid15r requested a review from KJhellico July 26, 2026 01:26
@arkid15r
arkid15r requested a review from PPsyrius July 26, 2026 01:26
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants